<template>
  <a-card :body-style="{ padding: '24px 32px' }" :bordered="false">
    <a-form layout="inline" @submit.prevent="save" class="ant-advanced-update-form">
      <a-row :gutter="24">
        <a-col :span="8">
          <a-form-item :label="$t('workflowApp.siteConfig.id')" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
            <a-input placeholder="input placeholder" v-model="$v.siteConfig.id.$model" id="site-config-id" name="id" read-only />
          </a-form-item>
        </a-col>
        <a-col :span="8">
          <a-form-item :label="$t('workflowApp.siteConfig.title')" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
            <a-input placeholder="input placeholder" v-model="$v.siteConfig.title.$model" id="site-config-title" name="title" />
          </a-form-item>
        </a-col>
        <a-col :span="8">
          <a-form-item :label="$t('workflowApp.siteConfig.remark')" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
            <a-input placeholder="input placeholder" v-model="$v.siteConfig.remark.$model" id="site-config-remark" name="remark" />
          </a-form-item>
        </a-col>
        <a-col :span="8">
          <a-form-item :label="$t('workflowApp.siteConfig.fieldName')" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
            <a-input placeholder="input placeholder" v-model="$v.siteConfig.fieldName.$model" id="site-config-fieldName" name="fieldName" />
          </a-form-item>
        </a-col>
        <a-col :span="8">
          <a-form-item :label="$t('workflowApp.siteConfig.fieldValue')" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
            <a-input
              placeholder="input placeholder"
              v-model="$v.siteConfig.fieldValue.$model"
              id="site-config-fieldValue"
              name="fieldValue"
            />
          </a-form-item>
        </a-col>
        <a-col :span="8">
          <a-form-item :label="$t('workflowApp.siteConfig.fieldType')" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
            <a-select placeholder="请选择" id="site-config-fieldType" name="fieldType" v-model="$v.siteConfig.fieldType.$model">
              <a-select-option value="INTEGER">{{ $t('workflowApp.CommonFieldType.INTEGER') }}</a-select-option>
              <a-select-option value="LONG">{{ $t('workflowApp.CommonFieldType.LONG') }}</a-select-option>
              <a-select-option value="BOOLEAN">{{ $t('workflowApp.CommonFieldType.BOOLEAN') }}</a-select-option>
              <a-select-option value="STRING">{{ $t('workflowApp.CommonFieldType.STRING') }}</a-select-option>
              <a-select-option value="FLOAT">{{ $t('workflowApp.CommonFieldType.FLOAT') }}</a-select-option>
              <a-select-option value="DOUBLE">{{ $t('workflowApp.CommonFieldType.DOUBLE') }}</a-select-option>
              <a-select-option value="ZONED_DATE_TIME">{{ $t('workflowApp.CommonFieldType.ZONED_DATE_TIME') }}</a-select-option>
              <a-select-option value="LOCATE_DATE">{{ $t('workflowApp.CommonFieldType.LOCATE_DATE') }}</a-select-option>
              <a-select-option value="BIG_DECIMAL">{{ $t('workflowApp.CommonFieldType.BIG_DECIMAL') }}</a-select-option>
              <a-select-option value="TEXTBLOB">{{ $t('workflowApp.CommonFieldType.TEXTBLOB') }}</a-select-option>
              <a-select-option value="IMAGEBLOB">{{ $t('workflowApp.CommonFieldType.IMAGEBLOB') }}</a-select-option>
              <a-select-option value="ARRAY">{{ $t('workflowApp.CommonFieldType.ARRAY') }}</a-select-option>
              <a-select-option value="ENUM">{{ $t('workflowApp.CommonFieldType.ENUM') }}</a-select-option>
              <a-select-option value="UPLOAD_IMAGE">{{ $t('workflowApp.CommonFieldType.UPLOAD_IMAGE') }}</a-select-option>
              <a-select-option value="UPLOAD_FILE">{{ $t('workflowApp.CommonFieldType.UPLOAD_FILE') }}</a-select-option>
              <a-select-option value="ENTITY">{{ $t('workflowApp.CommonFieldType.ENTITY') }}</a-select-option>
              <a-select-option value="RADIO">{{ $t('workflowApp.CommonFieldType.RADIO') }}</a-select-option>
              <a-select-option value="MULTI_SELECT">{{ $t('workflowApp.CommonFieldType.MULTI_SELECT') }}</a-select-option>
              <a-select-option value="DATA_DICTIONARY">{{ $t('workflowApp.CommonFieldType.DATA_DICTIONARY') }}</a-select-option>
              <a-select-option value="UUID">{{ $t('workflowApp.CommonFieldType.UUID') }}</a-select-option>
              <a-select-option value="INSTANT">{{ $t('workflowApp.CommonFieldType.INSTANT') }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
      </a-row>
      <a-row type="flex" justify="center">
        <a-col span="3">
          <a-button @click="previousState()">{{ $t('entity.action.cancel') }}</a-button>
        </a-col>
        <a-col span="3">
          <a-button html-type="submit" type="primary" :disabled="$v.siteConfig.$invalid || isSaving">{{
            $t('entity.action.save')
          }}</a-button>
        </a-col>
      </a-row>
    </a-form>
  </a-card>
</template>
<script lang="ts" src="./site-config-update-template.component.ts"></script>
<style>
.ant-advanced-update-form .ant-form-item {
  display: flex;
}
.ant-advanced-update-form .ant-form-item-control-wrapper {
  flex: 1;
}
</style>
